<template>
  <HeaderMenu></HeaderMenu>
  <!-- 页脚的宽度是-->
  <div style="padding-bottom: 70px">
    <router-view></router-view>
  </div>
  
  <!-- 音乐播放器 -->
<!--  <player></player>-->
  
  <!--  回顶部  -->
  <el-backtop :right="50" :bottom="150">
    <div class="to-top-button">
      <icon-to-top theme="outline" size="30" fill="#003bff" :strokeWidth="3"/>
    </div>
  </el-backtop>
  
  <!--  搜索  -->
  <Search></Search>
  
  <WebFoot></WebFoot>

</template>

<script>
import HeaderMenu from "@/components/index/HeaderMenu.vue";
import userStore from "@/store/UserStore"
import pinia from "@/store/pinia";
import WebFoot from "@/components/index/WebFoot.vue";
import Player from "@/components/zw-player/player.vue";
import Search from "@/components/search/Search.vue";

const store = userStore(pinia)

export default {
  name: "BaseView",
  components: {Search, Player, WebFoot, HeaderMenu},
  async created() {
    let token = window.sessionStorage.getItem("token")
    if (token) {
      let {data: userInfo} = await this.$http.get("/api/user/getUserInfo")
      window.sessionStorage.setItem("userInfo", JSON.stringify(userInfo))
      store.updateUserInfo(userInfo)
    }
  }
}
</script>

<style scoped>
.to-top-button {
  height: 100%;
  width: 100%;
  background-color: var(--el-bg-color-overlay);
  box-shadow: var(--el-box-shadow-lighter);
  text-align: center;
  line-height: 40px;
  color: #1989fa;
  padding-top: 5px;
}
</style>